<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />-->
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui/css/style.css" />
<link rel="stylesheet" href="/Public/css/page.css">

<link href="/Public/dxk/icheck.css" rel="stylesheet">
<script src="/Public/dxk/icheck.js?v=1.0.2"></script>
              
                <script>
                    $(document).ready(function(){
                        $('.user-sex input').each(function(){
                            var self = $(this),
                                    label = self.next(),
                                    label_text = label.text();

                            label.remove();
                            self.iCheck({
                                checkboxClass: 'icheckbox_sm-blue',
                                radioClass: 'radio_sm-blue',
                                insert: label_text
                            });
                        });
                    });
                </script>
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<title>消费业务</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 消费业务 <span class="c-gray en">&gt;</span> 消费列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>


<div class="page-container">
<form action="<?php echo U('Consump/index',array('p'=>$p));?>" method="post">
	<div class="text-c">
		<select name="type" class="select-box inline">
			<option value="1">贷款人姓名</option>
			<option value="2">推荐人</option>
            <option value="3">房屋地址</option>
		</select>
		<input type="text" name="content" id="content"  style="width:250px" class="input-text">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i>搜索</button>
	</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
	    <span class="l">
    	    <?php if(strstr($user_auth['level'],"39")){ ?><a href="javascript:;" onClick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <?php } ?>
    	    <?php if(strstr($user_auth['level'],"40")){ ?><a class="btn btn-primary radius" onClick="picture_add('建档','<?php echo U('Consump/consumptionadd');?>')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>建档</a><?php } ?>
	    </span> 
	    <span class="r">共有数据：<strong><?php echo ($num); ?></strong> 条</span> 
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">姓名</th>
                    <th width="120">建档时间</th>
					<th width="80">贷款银行</th>
					<th width="80">贷款金额（万元）</th>					
					<th width="75">推荐人</th>
					<th width="60">品种</th>
					<th width="120">抵押日期</th>
                    <th width="120">收费日期</th>
                    <th width="120">下款日期</th>
                    <th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(is_array($consume)): $i = 0; $__LIST__ = $consume;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
					<td><input type="checkbox" value="<?php echo ($vo["consume_id"]); ?>" name="id"></td>
					<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','<?php echo U('Consump/consumptionalert',array('consume_id'=>$vo['consume_id']));?>','10001')" title="查看"><?php echo ($vo["client_name"]); ?></u></td>
					<td><?php if($vo["creat_time"] != ''): echo (date("Y-m-d",$vo["creat_time"])); endif; ?></td>					
					<td><?php echo (getBankName($vo["bank_id"])); ?></td>
                    <td><?php echo ($vo["loan_amount"]); ?></td>
                    <td><?php echo (getUsername($vo["referrer_id"])); ?></td>
                    <td><?php if($vo["loan_type"] == 1): ?>信用贷<?php elseif($vo["loan_type"] == 2): ?>消费贷<?php elseif($vo["loan_type"] == 3): ?>企业贷<?php endif; ?></td>
					<td><?php if($vo["mortgage_time"] != ''): echo (date("Y-m-d",$vo["mortgage_time"])); endif; ?></td>
                    <td><?php if($vo["charge_time"] != ''): echo (date("Y-m-d",$vo["charge_time"])); endif; ?></td>
                    <td><?php if($vo["credit_time"] != ''): echo (date("Y-m-d",$vo["credit_time"])); endif; ?></td>
                    <td> <a style="text-decoration:none" class="ml-5" onClick="article_edit('查看','<?php echo U('Consump/consumptionalert',array('consume_id'=>$vo['consume_id']));?>','10001')" href="javascript:;" title="查看">查看</a> </td>				
				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
				
			</tbody>
		</table>
	</div>
	<div class="manu"><?php echo ($page); ?></div>
</div>



<script type="text/javascript" src="/Public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/static/h-ui.admin/js/H-ui.admin.js"></script>

<script type="text/javascript">
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 不参与排序的列
	]
});

/*建档-添加*/
function picture_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-删除*/

function datadel(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要删除的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"<?php echo U('Consump/delDatas');?>",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}
</script>
</body>
</html>